home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1996 June / MACPOWER-1996-06.ISO.7z / MACPOWER-1996-06.ISO / MacPowerオリジナル / キョービのプログラマー / リバースクライアント北白川 Folder / Souce Code (CodeWarrior7) / KMPL.h < prev    next >
Text File  |  1996-02-05  |  2KB  |  135 lines

  1. //##
  2. //##    ===        Kitashirakawa Macintosh Programming Laboraroty        ===
  3. //##    ===               Reverse Client Thikin' Module                  ===
  4. //##
  5. //##    File:        KMPL.h
  6. //##
  7. //##    Author:        Takenori Kabeya
  8. //##                (c)1996, all rights reserved.
  9. //##
  10. //##    Version:    1.0
  11. //##
  12. //##    History:
  13. //##                Created on        Feb. 1, 1996.
  14. //##
  15. //##
  16.  
  17. #pragma once
  18. #include    "Reverse.h"
  19.  
  20. #define        Max(X,Y)    ( ( (X) > (Y) ) ? (X) : (Y) )
  21. #define        Min(X,Y)    ( ( (X) < (Y) ) ? (X) : (Y) )
  22. #define        Abs(X)        ( ( (X) <  0  ) ? (-(X)) : (X) )
  23.  
  24. #define        rALRT_About        128
  25.  
  26. #define        kMin    0
  27. #define        kMax    (BOARD_SIZE-1)
  28.  
  29. #if    kMax < 5
  30.     #undef    kMax
  31. #endif
  32.  
  33. typedef long    Coord;
  34. typedef long    CellIndex;
  35. typedef long    NumReverse;
  36. typedef long    NumCell;
  37. typedef long    Color;
  38.  
  39. //
  40. //    ユーティリティ関数のプロトタイプ宣言
  41. //
  42.  
  43. Boolean
  44. IsStartOfGame(
  45.     BOARD    inBoard );
  46.  
  47. Boolean
  48. IsEmpty(
  49.     BOARD    inBoard,
  50.     Point    inCell );
  51.  
  52. Boolean
  53. IsOnBoard(
  54.     Point    inCell );
  55.  
  56. Boolean
  57. IsCorner(
  58.     Point    inCell );
  59.  
  60. Boolean
  61. IsCornerSide(
  62.     Point    inCell );
  63.  
  64. Boolean
  65. IsEdge(
  66.     Point    inCell );
  67.  
  68. Boolean
  69. IsOnLine(
  70.     Point    inCell1,
  71.     Point    inCell2 );
  72.  
  73. Boolean
  74. IsSuccessive(
  75.     BOARD    inBoard,
  76.     Point    inFrom,
  77.     Point    inTo,
  78.     Color    inColor );
  79.  
  80. Color
  81. GetReverseColor(
  82.     Color    inColor );
  83.  
  84. NumCell
  85. GetNextState(
  86.     REVERSE_REC*    inCurrentStateP,
  87.     Point            inPlaceCell,
  88.     REVERSE_REC*    outNextStateP,
  89.     PLACE_INFO*        outPlaceInfoP );
  90.  
  91. NumReverse
  92. CalcGain(
  93.     REVERSE_REC*    inCurrentStateP,
  94.     Point            inPlaceCell );
  95.  
  96. NumCell
  97. CountStones(
  98.     BOARD    inBoard,
  99.     Color    inColor );
  100.  
  101. void
  102. ReverseStones(
  103.     Point    inPlaceCell,
  104.     Color    inColor,
  105.     BOARD    ioBoard );
  106.  
  107. CellIndex
  108. FindLocalMinimumCellIndex(
  109.     PLACE_INFO*    inPlaceInfoP );
  110.  
  111. CellIndex
  112. FindLocalMaximumCellIndex(
  113.     PLACE_INFO*    inPlaceInfoP );
  114.  
  115. CellIndex
  116. FindLocalMinimumCellIndexFrom(
  117.     PLACE_INFO*    inPlaceInfoP,
  118.     CellIndex    inFrom );
  119.  
  120. CellIndex
  121. FindLocalMaximumCellIndexFrom(
  122.     PLACE_INFO*    inPlaceInfoP,
  123.     CellIndex    inFrom );
  124.  
  125. CellIndex
  126. FindCell(
  127.     PLACE_INFO*    inPlaceInfoP,
  128.     Point        inCell );
  129.  
  130. CellIndex
  131. FindCellFrom(
  132.     PLACE_INFO*    inPlaceInfoP,
  133.     Point        inCell,
  134.     CellIndex    inFrom );
  135.